import { Component, OnInit, ElementRef, ViewChild } from '@angular/core';
const tmpl=`


`;
@Component({
  selector: 'ads-show',
  templateUrl: './ads-show.component.html',
  styleUrls: ['./ads-show.component.css'],
  inputs:["miid"],
})
export class AdsShowComponent implements OnInit {
  miid:string="";
  @ViewChild('adsRoot') adsRoot: ElementRef;
  constructor() { }

  ngOnInit() {
    let  tanx_s = document.createElement("script");
    tanx_s.type = "text/javascript";
    tanx_s.charset = "gbk";
    tanx_s.id = "tanx-s-"+this.miid;
    tanx_s.async = true;
    tanx_s.src = "http://p.tanx.com/ex?i="+this.miid;
    let tanx_h = document.getElementsByTagName("head")[0];
    if(tanx_h)tanx_h.insertBefore(tanx_s,tanx_h.firstChild);
  }

}
